// Copyright 2018 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('flutter demo'),
        ),
        body: HomePage(),
      ),
      theme: ThemeData(primarySwatch: Colors.yellow),
    );
  }
}

class HomeContent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Center(
      child: Text(
        '你好Flutter',
        textDirection: TextDirection.ltr,
        style: TextStyle(fontSize: 40.0, color: Colors.yellow
            // color: Color.fromRGBO(244, 233, 121, 0.5)
            ),
      ),
    );
  }
}

class HomePage extends StatelessWidget {
  int countNum = 1;

  @override
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        SizedBox(
          height: 200,
        ),
        Text('${this.countNum}'),
        SizedBox(
          height: 20,
        ),
        RaisedButton(
          onPressed: () {
            this.countNum++;
            print(this.countNum);
          },
          child: Text("按钮"),
        )
      ],
    );
  }
}
